package com.six.day1;


import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
public class SeriakizeDemo {
    public static void main(String[] args) {
        User user = new User("lty",18,"123456");
        try{
            FileOutputStream fos = new FileOutputStream("D:\\新建文件夹 (2)\\ideaprojects\\stx_six_lty\\src\\com\\six\\User.txt");
            ObjectOutputStream oos =new ObjectOutputStream(fos);
            oos.writeObject(user);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
